package org.javaboy.demo;

import okhttp3.OkHttpClient;

import java.util.concurrent.TimeUnit;

/**
 * @author Lyh
 * @date 2024/2/20 1:41
 * @desciption:
 */
public class OkHttpClientStaticFactory {
    private static OkHttpClient okHttpClient;
    static {
        okHttpClient = new OkHttpClient.Builder()
                .connectTimeout(5, TimeUnit.SECONDS)
                .readTimeout(5, TimeUnit.SECONDS)
                .build();
    }
    public static OkHttpClient getInstance(){
        return okHttpClient;
    }
}
